package com.spsy.pay.listener;

import com.alibaba.fastjson.JSON;
import com.rabbitmq.client.Channel;
import com.spsy.common.vo.OrderVo1;
import com.spsy.order.api.OrderApi;
import com.spsy.pay.constant.RabbitMqConstant;
import com.spsy.pay.constant.RabbitMqConstantAli;
import com.spsy.pay.domain.TPaymentOrder;
import com.spsy.pay.service.ITPaymentOrderService;
import com.spsy.pay.vo.OrderPayEnum;
import com.spsy.pay.vo.RabbitVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.List;

/**
 * @Author: Kyrie Irving
 * @Date: 2025/9/23 17:04
 * @Description:
 **/
@Component
@RabbitListener(queues = RabbitMqConstantAli.MQ_NAME)
@Slf4j
public class RabbitmqAliListener {

    @Autowired
    private ITPaymentOrderService itPaymentOrderService;



    @RabbitHandler
    public void handler(String str,Message message,Channel channel) throws Exception {
        System.out.println(str);
        channel.basicNack(message.getMessageProperties().getDeliveryTag(),false,false);

        //channel.basicNack(message.getMessageProperties().getDeliveryTag(),false,true);
    }
}
